//
//  MRCountry_messageViewController.m
//  Travel_World
//
//  Created by dllo on 15/10/15.
//  Copyright © 2015年 TLS. All rights reserved.
//

#import "MRCountry_messageViewController.h"

@interface MRCountry_messageViewController ()<UIWebViewDelegate>

@property(nonatomic,retain)UIActivityIndicatorView *activityIndicator;

@property (nonatomic, strong) UIWebView *webView;

@end

@implementation MRCountry_messageViewController

//- (void)dealloc
//{
//    self.webView.delegate = nil;
//}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.translucent = YES;
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bigShadow"] forBarMetrics:UIBarMetricsCompact];
    self.navigationController.navigationBar.layer.masksToBounds = YES;
    
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, WIDTH, HEIGHT)];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
    [self.view addSubview:self.webView];
    [self.webView loadRequest:request];
    
//    self.webView.delegate = self;
    
}

//// 加载等待界面
//-(void)webViewDidStartLoad:(UIWebView *)webView
//{
//    UIImageView *myImageView = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
//    
//    myImageView.image = [UIImage imageNamed:@"placeholder"];
//    myImageView.tag = 1;
//    [self.view addSubview:myImageView];
//    
//    self.activityIndicator = [[UIActivityIndicatorView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
//    [self.activityIndicator setCenter:self.view.center];
//    [self.activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
//    [self.view addSubview:self.activityIndicator];
//    
//    [self.activityIndicator startAnimating];
//    
//}
//
//-(void)webViewDidFinishLoad:(UIWebView *)webView
//{
//    [self.activityIndicator stopAnimating];
//    UIImageView *myImageView = (UIImageView *)[self.view viewWithTag:1];
//    [myImageView removeFromSuperview];
//    
//}
//
//-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
//{
//    [self.activityIndicator stopAnimating];
//    UIImageView *myImageView = (UIImageView *)[self.view viewWithTag:1];
//    [myImageView removeFromSuperview];
//}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
